package com.itheima.day06;

public class DemoJz {
    public static void main(String[] args) {
       /* System.out.println("十进制:"+50);
        System.out.println("二进制:"+0b1000001);
        System.out.println("八进制:"+011);
        System.out.println("十六进制:"+0x0101);*/

        //赋值交换1
        /*int a = 10;
        int b = 20;
        int temp = a;
        a = b;
        b = temp;
        System.out.println("a:"+a+", "+"b"+b);*/

        //赋值交换2
        /*int a = 10;
        int b = 20;
        a = a + b;
        b = a - b;
        a = a - b;
        System.out.println("a:" + a + ", " + "b" + b);*/

        //赋值交换3
        /*int a = 10;
        int b = 20;
        a = a ^ b;
        b = a ^ b;
        a = a ^ b;
        System.out.println("a:" + a + ", " + "b" + b);*/

        //定义数组
        int[] arr = {11, 22, 33, 44, 55, 66};

        //定义初始值
        int start = 0;
        int end = arr.length - 1;

        //判断 初始值最小到最大 循环start不超过end
        while (start < end) {
                //赋值转换
                arr[start] = arr[start] + arr[end];
                arr[end] = arr[start] - arr[end];
                arr[start] = arr[start] - arr[end];
                //步进表达
                start++;
                end--;
        }
            System.out.print("[");
        //循环遍历
        for (int i = 0; i < arr.length; i++) {
            if (i == arr.length - 1) {
                System.out.println(arr[i] + "]");
            } else {
                System.out.print(arr[i] + ", ");
            }
        }
    }
}
